// Copyright (C) 2012 Volkov Zachar
// This file is part of the "zAxis Game Engine".
// For conditions of distribution and use, see copyright notice zx_Common.hpp

#include "zx_Video.hpp"
#include "gl/glew.h"

namespace zx {

//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//
Sampler::Sampler( TexturePtr _texture, TextureWrap _str, TextureFilter _filter ) : m_texture( _texture )
                                                                                 , m_wrap_s( _str )
                                                                                 , m_wrap_t( _str )
                                                                                 , m_wrap_r( _str )
                                                                                 , m_min_filter( _filter )
                                                                                 , m_mag_filter( zxChoose( _filter == TF_NEAREST || _filter == TF_LINEAR, _filter, TF_LINEAR ) )
{
}
//----------------------------------------------------------------------------//
void Sampler::SetWrap( TextureWrap _s, TextureWrap _t, TextureWrap _r )
{
     m_wrap_s = _s;
     m_wrap_t = _t;
     m_wrap_r = _r;
}
//----------------------------------------------------------------------------//
void Sampler::SetFilter( TextureFilter _min, TextureFilter _mag )
{
     m_min_filter = _min;
     m_mag_filter = zxChoose( _mag == TF_NEAREST || _mag == TF_LINEAR, _mag, TF_LINEAR );
}
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//

} // namespace zx
